<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="js/jquery.js"></script>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script language="javascript" type="text/javascript" src="editarea/edit_area_full.js"></script>
<script language="javascript" type="text/javascript">
editAreaLoader.init({
	id : "editor",		// textarea id
	syntax: "java",		// syntax to be uses for highgliting
	start_highlight: true,		// to display with highlight mode on start-up
	allow_toggle: false,
	toolbar: "search, go_to_line, fullscreen, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help",
	show_line_colors: true,
	syntax_selection_allow: "css,html,js,sql,java",
	replace_tab_by_spaces: 4,
	language: "zh",
	submit_callback: "Run()"
});
</script>
<title>Java代码在线编译系统</title>
</head>
<body>
	<div id="header">
	<h1>Java代码在线编译系统</h1>
	</div><br/>
	<form action="compile">
	<label>ClassName: </label><input id="fileName" type="text" name="fileName" value="Hello"><br/>
	<label>Code: </label><br/>
	<textarea id="editor" name="content" style="height: 350px; width: 100%;">
// 这是一个示例程序
public class Hello {
	public static void main(String[] args) {
		System.out.println("Hello, World!");
	}
}</textarea><br/>
	</form>
	<button id="run" name="run" type="submit" >Try it!</button>
	<br/><br/>
	<label>运行结果:</label><br/>
	<pre id="result" >
	</pre>
	
	<script type="text/javascript">
		$(function() {
			$("#run").click(function() {
				Run();
			});
		});
		function Run() {
			$.post("compile", 
					{
					fileName: $("#fileName").val(), 
					code: editAreaLoader.getValue("editor")
					}, 
					function(result) {$("#result").html(unescape(result));}
			);
		}
	</script>
	<div id="rooter">
		<hr>
		<p align="center"><a href="index_simple.html" style="color: white;">简易版本</a> <a href="browser.jsp" style="color: white;">文件浏览</a>  2012版权所有 &copy; icejoywoo</p>
	</div>
	<!-- JiaThis Button BEGIN -->
	<script type="text/javascript" src="http://v2.jiathis.com/code/jiathis_r.js?type=right" charset="utf-8"></script>
	<!-- JiaThis Button END -->
</body>
</html>